package com.duobaoyu.dby.supply.job.task.channel;

import com.duobaoyu.dby.channel.adapter.enums.ChannelCodeEnum;
import com.duobaoyu.dby.channel.adapter.enums.biz.message.MessageTypeEnum;
import com.duobaoyu.dby.supply.biz.client.boundary.message.ChannelPullMessageBoundaryClient;
import com.duobaoyu.dby.supply.core.dinger.annotation.DingerTalk;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 渠道任务
 *
 * @author fengshaoyu
 * @version 1.0.0
 * @date 2023/9/26 17:32
 */
@Component
@RequiredArgsConstructor
public class ChannelOrderTask {

	private final ChannelPullMessageBoundaryClient channelPullMessageBoundaryClient;

	/**
	 * 京东消息------------------------------------------------------------------------------------------------------
	 */
	@XxlJob("jdOrderSplitChangeJob")
	@DingerTalk(title = "京东拆单消息")
	public void jdOrderSplitChangeJobHandler() {
		channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.JD_VOP, MessageTypeEnum.ORDER_SPLIT,null);
	}

	@XxlJob("jdCompleteOrderChangeJob")
	@DingerTalk(title = "京东订单妥投消息")
	public void jdCompleteOrderChangeJobHandler() {
		channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.JD_VOP, MessageTypeEnum.COMPLETE_ORDER,null);
	}

	@XxlJob("jdCancelOrderChangeJob")
	@DingerTalk(title = "京东订单取消消息")
	public void jdOrderStateChangeJobHandler() {
		channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.JD_VOP, MessageTypeEnum.CANCEL_ORDER,null);
	}

	@XxlJob("jdLogisticsOrderChangeJob")
	@DingerTalk(title = "京东订单配送单生成消息")
	public void jdLogisticsOrderChangeJobHandler() {
		channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.JD_VOP, MessageTypeEnum.DELIVERY_SUCCESS,null);
	}

	/**
	 * 京东消息------------------------------------------------------------------------------------------------------
	 */

	/**
	 * 壹钱包消息------------------------------------------------------------------------------------------------------
	 */
	@XxlJob("oneWalletLogisticsOrderChangeJob")
	@DingerTalk(title = "壹钱包订单配送单生成消息")
	public void neWalletLogisticsOrderMessage() {
		channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.ONE_WALLET, MessageTypeEnum.DELIVERY_SUCCESS,null);
	}
	/**
	 * 壹钱包消息------------------------------------------------------------------------------------------------------
	 */

	/**
	 * 震坤行消息------------------------------------------------------------------------------------------------------
	 */
	@XxlJob("zkhCancelOrderChangeJob")
	@DingerTalk(title = "震坤行订单取消消息")
	public void zkhCancelOrderMessage() {
		channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.ZKH, MessageTypeEnum.CANCEL_ORDER,null);
	}

	@XxlJob("zkhCompleteOrderChangeJob")
	@DingerTalk(title = "震坤行订单妥投消息")
	public void zkhCompleteOrderMessage() {
		channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.ZKH, MessageTypeEnum.ORDER_COMPROMISE,null);
	}

	@XxlJob("zkhLogisticsOrderChangeJob")
	@DingerTalk(title = "震坤行订单配送单生成消息")
	public void zkhLogisticsOrderMessage() {
		channelPullMessageBoundaryClient.loopPullChannelMessage(ChannelCodeEnum.ZKH, MessageTypeEnum.DELIVERY_SUCCESS,null);
	}
	/**
	 * 震坤行消息------------------------------------------------------------------------------------------------------
	 */
}
